using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using Common.Utilities.Dispatcher;

namespace Workflows.Components
{
    /// <summary></summary>
    public delegate void UpdateComponentSettings(object activityNode, WorkflowComponentBase wfComponent);

    /// <summary></summary>
    public class TestResult
    {
        private bool _Succeed;
        /// <summary></summary>
        public bool Succeed
        {
            get { return _Succeed; }
            set { _Succeed = value; }
        }

        private string _Message;
        /// <summary></summary>
        public string Message
        {
            get { return _Message; }
            set { _Message = value; }
        }

        /// <summary></summary>
        public TestResult(bool succeed, string msg)
        {
            this._Succeed = succeed;
            this._Message = msg;
        }
    }

    /// <summary></summary>
    public interface IComponentEditor 
    {
        /// <summary>
        /// pass updated instruction to workflow designer
        /// </summary>
        event UpdateComponentSettings UpdateComponentSettingEvent;

        #region props
        /// <summary></summary>
        object OwnerActivityNode
        {
            get;
            set;
        }

        /// <summary></summary>
        Type WorkflowComponentType
        {
            get;
        }

        
        #endregion

        /// <summary></summary>
        void LoadSettings(
            GlobalVariable[] globalVars, 
            WorkflowComponentBase[] fromComponents, 
            object activityNode, 
            WorkflowComponentBase wfComponent);

        /// <summary></summary>
        void SaveSettings();

        /// <summary></summary>
        TestResult Test();
    }
}
